How can import data from particular row or column?
sqoop import –connect jdbc:mysql://db.one.com/corp --table EMP --where "start_date> ’2016-07-20"
sqoopeval --connect jdbc:mysql://db.test.com/corp --query "SELECT * FROM intellipaat_emp LIMIT 20"
sqoop import –connect jdbc:mysql://localhost/database --username root --password aaaaa –columns "name,emp_id,jobtitle"
How can we can control the number of mappers?
-m -num-mappers
How will you updates the rows that are already exported?
By using the parameter – update-key we can update existing rows. Comma-separated list of columns is used which uniquely identifies a row. All of these columns are used in the WHERE clause generated UPDATE query. All other table columns will be used in the SET part of the query.
How you list all the columns of a table using Apache Sqoop?
Sqoop import –m1 –connect 'jdbc:sqlserver://servername;database=databasename; Username-root;password=mypassword' –query "SELECT column_name,DATA_TYPE FROM INFORMATION_SCHEMA columns WHERE table_name='mytableofinterest' AND \$CONDITIONS" –target-dir 'column_name'
Mentioned the best features of Apache Sqoop.
Apache Sqoop is a tool in Hadoop ecosystem have several advantages. Like
- Parallel import/export
- Connectors for all major RDBMS Databases
- Import results of SQL query
- Incremental Load
- Full Load
- Kerberos Security Integration
- Load data directly into Hive / HBase
- Compression
- Support for Accumulo
No comments:
Post a Comment